const http = require('http')
const queryString = require('querystring')
const fs = require('fs')
const urlLib = require('url')
http.createServer(function(req,res){
	//post req
	//data 有一段数据（很多次）
	let str  = '' //接收数据
	let i = 0

	req.on('data',function(data) {
		console.log(`第${i++}次`)
		str += data
	})

	req.on('end',function(){
		let post = queryString.parse(str)
		console.log(post)
	})

	res.write('aaa')
	res.end()
}).listen(8080)